﻿--USE BookShelfDB
--GO

--IF OBJECT_ID('[dbo].[Book]') IS NOT NULL
--BEGIN
    --DROP TABLE [dbo].[Book]
    --IF OBJECT_ID('[dbo].[Book]') IS NOT NULL
        --PRINT '<<< FAILED DROPPING TABLE [dbo].[Book] >>>'
--END
--GO

CREATE TABLE [dbo].[Book]
(
	ID int IDENTITY(1,1) NOT NULL,
	Isbn varchar(13) NOT NULL,
	Title varchar(80) NOT NULL,
	PublicationDate datetime NOT NULL,
	BindingID int NOT NULL,
	Pages int NULL,
	LastUpdate datetime NOT NULL,
	LastUpdatedBy varchar(20) NOT NULL,
	Active bit NOT NULL DEFAULT((1)),
	
	CONSTRAINT [PK_Books] PRIMARY KEY CLUSTERED 
	(
		[ID] ASC
	)
	WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
--GO

--IF OBJECT_ID('[dbo].[Book]') IS NULL
	--PRINT '<<< FAILED CREATING TABLE [dbo].[Book] >>>'
--GO
